<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link href="{$CSS_PATH}bootstrap.min.css" rel="stylesheet">
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
      .hiddens {
        height: 100px; 
        overflow:hidden; 
        text-overflow:ellipsis; 
        display:-webkit-box; 
        -webkit-box-orient:vertical; 
        -webkit-line-clamp:4; 
      }
    </style>
  </head>
  <body style="background: #f3f3f3;">
    <!-- 顶部导航条 -->
    <nav class="navbar navbar-default" style="margin:0;padding: 12px 0;border-bottom: 1px solid rgba(30,35,42,.12); background-color: #fff;box-shadow: 0 1px 3px 0 rgba(0,34,77,.08);">
        <div class="col-md-2"></div>
        <div class="col-md-8">
              <div class="container-fluid">
                <!-- Brand and toggle get grouped for better mobile display -->
                <div class="navbar-header">
                  <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                  </button>
                  <a class="navbar-brand" href="#">U Say</a>
                </div>

                <!-- Collect the nav links, forms, and other content for toggling -->
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                  <ul class="nav navbar-nav">
                    <li class="active"><a href="{:url('index/index/index')}">首页 <span class="sr-only">(current)</span></a></li>
                    <li><a href="{:url('index/question/index')}">问题广场</a></li>
                    <li class="dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">分类 <span class="caret"></span></a>
                      <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">One more separated link</a></li>
                      </ul>
                    </li>
                  </ul>
                  <form class="navbar-form navbar-left">
                    <div class="form-group">
                      <input type="text" class="form-control" placeholder="有问题？" style="width:320px;" id="search-input">
                    </div>
                    <button type="submit" class="btn btn-default">搜索</button>
                  </form>
                  <ul class="nav navbar-nav navbar-right">
                    <li><a href="#" class="btn active" role="button" style=" padding: 8px; margin: 7px; color: #fff; background: #2F2567;">登录/注册</a></li>
                    <li class="dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">用户<span class="caret"></span></a>
                      <ul class="dropdown-menu">
                        <li><a href="#">我的收藏</a></li>
                        <li><a href="#">我的提问</a></li>
                        <li><a href="#">我的回答</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">退出登录</a></li>
                      </ul>
                    </li>
                  </ul>
                </div><!-- /.navbar-collapse -->
              </div><!-- /.container-fluid -->
        </div>
        <div class="col-md-2"></div>
    </nav>

    <!-- 列表部分 -->
    <div class="container" style="margin-top: 26px;">
      <div class="row">
        <!-- 左侧问题 -->
        <div class="col-md-8">
          {volist name="data" id="v"}
          <!-- 面板即为一个问题 -->
          <div class="panel panel-default">
            <!-- 问题标题 -->
            <div class="panel-heading" style="overflow: hidden;">
              <h3 style="margin:0;"><a href="{:url('index/Question/read','id='.$v['id'])}">{$v['title']}</a></h3>
            </div>
            <!-- 问题内容  class="hiddens"-->
            <div class="panel-body" style="padding-bottom: 16px;">
              <p style="line-height: 25px;">{$v['content']}</p>
             
	          <a style="display:none;text-align: center; color: #175199;font-size: 14px;"  class="showContent">
	              展开全部
	          </a>
              <!-- 附加操作 点赞等 -->
              <div>
                
              </div>
            </div>
          </div>
          <!-- 问题面板结束 -->
          {/volist}
          
        </div>
        <!-- 右侧推广 -->
        <div class="col-md-4">
          <div style="background-color: #fff;">
            这边是推广
          </div>
        </div>
      </div>
    </div>

    <h1>你好，世界！</h1>


    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="{$JS_PATH}bootstrap.min.js"></script>

    <script type="text/javascript">
      // 判断内容溢出
	    $('.showContent').prev("p").each(function (i){
	    	if($(this).height() > 100){
	          $(this).next('.showContent').css('display','block');
	          $(this).addClass('hiddens');
	        } 
	    });
      // 展示问题内容
      $('.showContent').click(function(){
          $(this).prev("p").removeClass('hiddens');
          $(this).css('display','none');
      	}
      );
    </script>
  </body>
</html>